/*
 * @Author: c
 * @Date: 2023-11-30 08:42:02
 * @LastEditTime: 2023-12-27 13:36:47
 * @LastEditors: c
 * @Description: 
 * @FilePath: \music-web-backend\src\auth\auth.module.ts
 * https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { Module } from '@nestjs/common';
import { JwtModule } from '@nestjs/jwt';
import { APP_GUARD } from '@nestjs/core';

import { AuthGuard } from '../../../common/guard/auth.guard';
import { AuthController } from './auth.controller';
import { AuthService } from './auth.service';

import { jwtConstants } from './constants';
import { PassportModule } from '@nestjs/passport';
import { UserLoginAuth } from './local.strategy';
import { JwtStrategy } from './jwt.strategy';
import { JwtAuthGuard } from './guard/jwt-auth.guard';
import { User } from '../user/entities/user.entity';
import { TypeOrmModule } from '@nestjs/typeorm';
import { UserModule } from 'src/core/system/user/user.module';
@Module({
  imports: [
    PassportModule,
    UserModule,
    JwtModule.register({
      global: true,
      secret: jwtConstants.secret,
      signOptions: { expiresIn: '36000s' },
    }),
   
  ],
  controllers: [AuthController],
  providers: [
    JwtStrategy,
    UserLoginAuth,
    AuthService, {
    provide: APP_GUARD,
    // useClass: AuthGuard,
    useClass: JwtAuthGuard,
  },]
})
export class AuthModule { }
